The Developed Application: Directory Service

(Client and Server)

You are required to design and implement a simple directory service which enables

clients to query the server for entries in a directory which is managed by the server.

The service provides a single point of contact for all name queries within the

organisation. For every person in the directory, the server maintains a list of

• id number,

• name,

• address,

• email,

• phone number,

• and location (building and room number)

In order to implement this application, you are required to design and implement the

following:

• The server software which continuously listens on a specific port waiting for

clients to connect and send their queries.

• The client software which is used to connect to the server on the specified

port. The client sends messages to the server and waits for the response to be

displayed to the user.

• The application protocol, including description of the message types

exchanged between the client and server. This should include description of

each field for each message type.

• The directory information structure and storage format.

 

 

 

 

 

The client

The client should be a program that executes from the command line and connects to

the server in order to exchange messages according to your application protocol. The

program should provide a simple user interface from the command line by which the

user should be able to do the following:

• Query the server using a person’s id number to retrieve the full list of

information about the person in the directory. Upon receipt of information

from the server, the client should display the information appropriately on the

screen.

• Query the server for the name of a person or persons whose location is

specified by a combination of building name and room number. The server

should return a list of all id numbers of the matching entries

• Add a new entry to the server.

• Delete an entry from the server.

The server

The server is a program which should be run as a demon (continuously running and

listening for client connections). The server should perform the following tasks:

• Maintains persistent information storage of the directory; that is the server

should not lose the information in case of shut down or failure.

• Accepts clients’ connections and responds to directory requests.

• Acknowledges the clients’ messages by sending data or control messages to

signify if a request was success or failure, according to the communication

protocol.

• When finished servicing a client, the server should go back listening to more

clients

• (Optionally) facilitate multiple-client connections simultaneously (i.e.

multithreading)

The protocol (Due on Friday 8th December 2006)

The protocol should be designed using a hand-shake mechanism, such that all requests

are acknowledged by the server. The protocol should describe in detail all messages

exchanged between the client and server, which fall under these message types.

• Error messages, which are used to indicate status information when an error

has occured.

• Query messages, which are used to indicate requests from the client and

responses from the server containing the queries and the retrieved information.

• Admin messages, which are used to indicate directory maintenance tasks such

as add, delete and update entries in the directory or stop (shutdown) the

server.

The directory structure

The directory structure design should include information about how the information

is stored on disk and in memory. The following are some of the questions that you

need to think about and decide on:

• Would the directory use flat files or a database to store entries?

 

• What is the structure of the information to be stored with? If a database is used

then this means the database schema; if the directory is stored in a file, then

this means the storage format of the fields (e.g. each entry on a single line and

fields are delimited by commas)

• What is the data structure used for holding information in memory when the

data is read from disk (e.g. using a map, a vector, an array or another

structure).

• How does the server access the information? Does it load the entire directory

into memory at start-up and only writes on updates? Or, does it keep the

information on disk and performs the searches directly on an open file? What

are the pros and cons for each method?

 

Deliverables

Upon completion of the coursework, you should submit the following as outlined on

the first page of this specification.

Deliverable Deadline

Date

1. Detailed description of the protocol including the format each

message.

8/12/06

2. One group report (printed) containing the following:

a. A description of the presented solution including the overall

architecture diagram, the application protocol message flow

and the file storage format.

b. A class diagram outlining the object-oriented design for each

of the client and server software.

c. Evaluation of the overall program performance. This could

take the form of screen shots and a log of all the messages

exchanged between the client and server.

d. A description of how the system is used.

18/01/07

3. A CD containing the following:

a. The executable file(s) for both the client and server software.

b. The source code files and Visual Studio project definition file

for the solution.

c. A README file containing instructions about how the

programs should be run, with information about any

requirements such as library or DLL files needed for the

program to compile and run.

18/01/07